package com.tanhua.db.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.pojo.BlackList;
import com.tanhua.model.pojo.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BlackListMapper extends BaseMapper<BlackList> {

    //根据用户id  分页查询黑名单用户的详情
    //使用MyBatis Plus的分页助手，只需要把分页对象page传入，MyBatis Plus就可以自动实现分页
    @Select("select * from tb_user_info  where id in(" +
            "select black_user_id from tb_black_list where user_id=#{userId})")
    Page<UserInfo> findBlackList(@Param("pages") Page<UserInfo> pages, @Param("userId") Long userId);
}
